<?php
/* @var $this UsersController */
/* @var $model Users */
/* @var $form CActiveForm */
?>
<?php
	Yii::app()->clientScript->registerScript('login', "
		$(function(){
			if($('.errorSummary').html() != undefined) {
				$('#dialogError').dialog('open');
			}
		});
	");
?>
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'users-form',
	'enableAjaxValidation'=>false,
)); ?>

	<?php	$this->beginWidget('zii.widgets.jui.CJuiDialog', array( 
		'id'=>'dialogError',
		'options'=>array(
			'autoOpen'=>false,
			'modal'=>true,
			'buttons'=>array('Ok' => 'js:function() { $(this).dialog(\'close\'); }'),
			'width'=>'auto',
			'height'=>'auto',
			'resizable'=>false
		),
	));
	echo $form->errorSummary($model);
	$this->endWidget(); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'first_name'); ?>
		<?php echo $form->textField($model,'first_name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'second_name'); ?>
		<?php echo $form->textField($model,'second_name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'email'); ?>
		<?php echo $form->textField($model,'email'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'type'); ?>
		<?php echo $form->dropDownList($model,'type',array(2=>'Opiekun sali',3=>'Nauczyciel',4=>'Student')); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Utwórz' : 'Zapisz'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->